// import APP from '@/components/app'
import { createRouter, createWebHistory } from "vue-router";

export const menuRouter = [
  {
    path: "/usercenter",
    name: "UserCenter",
    component: () => import("@/views/usercenter/index.vue"),
    meta: { icon: "menu-pay", title: "会员中心", noNeedLogin: true }
  },
  {
    path: "/coupon",
    name: "Coupon",
    component: () => import("@/views/coupon-center/index.vue"),
    meta: { icon: "menu-coupon", title: "领券中心" }
  },
  {
    path: "/orderlist",
    name: "OrderList",
    component: () => import("@/views/order-list/index.vue"),
    meta: { icon: "menu-order", title: "消费记录" }
  },
  {
    path: "/account",
    name: "Account",
    component: () => import("@/views/account/index.vue"),
    meta: { icon: "menu-login", title: "账号管理" }
  },
  {
    path: "/feedback",
    name: "Feedback",
    component: () => import("@/views/feedback/index.vue"),
    meta: { icon: "menu-feedback", title: "意见反馈", noNeedLogin: true }
  }
];

export const constantRoutes = [
  {
    path: "/",
    redirect: menuRouter[0].path,
    component: () => import("@/layout/index.vue"),
    children: menuRouter
  },
  {
    path: "/guided-payment",
    name: "Pay",
    component: () => import("@/views/pay/index.vue"),
    meta: { noNeedLogin: true }
  },
  // {
  //   path: '/v2',
  //   component: APP,
  //   children: [
  //     {
  //       path: 'pay-success',
  //       name: 'PaySuccessV2',
  //       component: () => import('@/views/rights-v2/pay-success.vue')
  //     }
  //   ]
  // },
  {
    path: "/login-page",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
    meta: { noNeedLogin: true }
  },
  {
    path: '/bind-user-page',
    name: 'BingUser',
    component: () => import('@/views/bind-user/index.vue'),
    meta: { noNeedLogin: true }
  }
];
export default createRouter({
  history: createWebHistory(),
  scrollBehavior: () => ({ top: 0 }),
  routes: constantRoutes
});
